package edu.wit.acl.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author testjava
 * @since 2020-01-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("acl_user")
@ApiModel(value = "User对象", description = "用户表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "会员id")
    @TableId(value = "id", type = IdType.ID_WORKER_STR)
    private String id;

    @ApiModelProperty(value = "用户名")
    private String username;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "昵称")
    private String nickName;

    @ApiModelProperty(value = "所属机构")
    private Integer ins;

    @ApiModelProperty(value = "用户头像")
    private String salt;

    @ApiModelProperty(value = "用户签名")
    private String token;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "逻辑删除 1（true）已删除， 0（false）未删除")
    private Boolean isDeleted;

    @ApiModelProperty(value = "是否启用")
    private String status;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "用户角色")
    @TableField(fill = FieldFill.INSERT_UPDATE,exist = false)
    private String roleName;

    @ApiModelProperty(value = "用户角色id")
    @TableField(fill = FieldFill.INSERT_UPDATE,exist = false)
    private String roleId;

    @ApiModelProperty(value = "所属企业")
    private String enterpriseName;

    @ApiModelProperty(value = "用户描述")
    private String description;

    @ApiModelProperty(value = "父节点")
    private String pid;

    @ApiModelProperty(value = "用户属于什么类别，主要是用来区分1-昊广，2-项目负责人，3-劳资负责人")
    private int category;

    @ApiModelProperty(value = "操作人id号")
    private String operatorId;

    @ApiModelProperty(value = "操作人姓名")
    @TableField(exist = false)
//    private String operator;
    private String createBy;

    @ApiModelProperty(value = "最后登录ip")
    private String loginIp;
}
